package com.foreknow.demo4;

/**
 * 有返回值类型的方法
 */
public class TestMethod7 {

    public static int A(int a) {
        return a;
    }

    public static String B(String name) {
        return "a";
    }

    public static int[] C() {
        int[] array = {1,2,3,4,5};
        return array;
    }

    public static int[] D(int[] array) { // 12345
        return array;
    }

    public static void main(String[] args) {
        int num = TestMethod7.A(12);
        System.out.println(num);
        String name = TestMethod7.B("tom");
        System.out.println(name);
        int[] arr = TestMethod7.C();
        for(int i = 0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
        System.out.println("--------------------------------------");
        int[] array = {1,2,3,4,5};
        int[] a = TestMethod7.D(array);
        for(int i = 0;i<a.length;i++){
            System.out.println(a[i]);
        }
    }
}
